<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="utf-8">
  <title><!--{$lang.page.index.title}--></title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/static/lay/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/static/lay/layui/index.css" media="all">
</head>
<body>

<div class="layui-fluid">
    <div class="layui-text-item" style="text-align: center;"><b><!--{$lang.page.public.user}--></b></div>
     <div class="layui-card">
      <div class="layui-form " >
        <div class="layui-text-item">
          <div class="layui-text-line">
            <label class="layui-text-label"><!--{$lang.page.table.account}--></label>
            <div class="layui-text-inline">
              <!--{$datainfo.username}-->
            </div>
          </div>
          <div class="layui-text-line">
            <label class="layui-text-label"><!--{$lang.page.table.realname}--></label>
            <div class="layui-text-inline">
              <!--{$datainfo.realname}-->
            </div>
          </div>
          <div class="layui-text-line">
            <label class="layui-text-label"><!--{$lang.page.table.phone}--></label>
            <div class="layui-text-inline">
              <!--{$datainfo.mobile}-->
            </div>
          </div>
          <div class="layui-text-line">
            <label class="layui-text-label"><!--{$lang.page.public.email}--></label>
            <div class="layui-text-inline">
              <!--{$datainfo.email}-->
            </div>
          </div>
          <div class="layui-text-line">
            <label class="layui-text-label"><!--{$lang.page.table.withdrawal}--><!--{$lang.page.table.money}--></label>
            <div class="layui-text-inline">
              <!--{$datainfo.cash}-->
            </div>
          </div>
          <div class="layui-text-line">
            <label class="layui-text-label"><!--{$lang.page.table.account}--><!--{$lang.page.table.balance}--></label>
            <div class="layui-text-inline">
              <!--{$datainfo.amount}-->
            </div>
          </div>
          <div class="layui-text-line">
            <label class="layui-text-label"><!--{$lang.page.table.give}--><!--{$lang.page.table.money}--></label>
            <div class="layui-text-inline">
              <!--{$datainfo.integra}-->
            </div>
          </div>
          <div class="layui-text-line">
            <label class="layui-text-label"><!--{$lang.page.table.virtual}--><!--{$lang.page.table.money}--></label>
            <div class="layui-text-inline">
              <!--{$datainfo.giftamount}-->
            </div>
          </div>
        </div>
      </div>
     </div>
    </div>
    <div class="layui-card">
              <div class="layui-tab layui-tab-brief layadmin-latestData">
                <ul class="layui-tab-title">
                  <li <!--{if empty($action) || $action=='withdraw'}-->class="layui-this"<!--{/if}-->><!--{$lang.page.table.cashout}--></li>
                  <li <!--{if $action=='recharge'}-->class="layui-this"<!--{/if}-->><!--{$lang.page.table.cashin}--></li>
                </ul>
                <div class="layui-tab-content">
                  <div <!--{if empty($action) || $action=='withdraw'}-->class="layui-tab-item layui-show"<!--{else}-->class="layui-tab-item"<!--{/if}-->>
                    <script type="text/html" id="zizeng">{{d.LAY_TABLE_INDEX+1}}</script>
                    <table id="withdrawlist"  lay-filter="withdrawlist"></table>
                    <script type="text/html" id="withdrawtop">
                        <div class="layui-btn-container">
                            <button class="layui-btn layui-btn-sm" lay-event="rewithdraw"><!--{$lang.page.public.refresh}--></button>
                            <button class="layui-btn layui-btn-sm withdraw muetool" data-set="<!--{$datainfo.aid}-->"><!--{$lang.page.public.add}--></button>
                        </div>
                    </script>
                    <script type="text/html" id="withdrawlistbar">
                        <a class="layui-btn layui-btn-xs pay" data-set="{{d.id}}"><!--{$lang.page.table.examine}--></a>
                    </script>
                  </div>

                  <div <!--{if $action=='recharge'}-->class="layui-tab-item layui-show"<!--{else}-->class="layui-tab-item"<!--{/if}-->>
                    <table id="recharge" lay-filter="recharge"></table>
                    <script type="text/html" id="rechargetop">
                        <div class="layui-btn-container">
                            <button class="layui-btn layui-btn-sm" lay-event="rerecharge"><!--{$lang.page.public.refresh}--></button>
                            <button class="layui-btn layui-btn-sm recharge muetool" data-set="<!--{$datainfo.aid}-->"><!--{$lang.page.public.add}--></button>
                        </div>
                    </script>
                    <script type="text/html" id="rechargebar">
                        <a class="layui-btn layui-btn-xs redit" data-set="{{d.id}}"><!--{$lang.page.table.examine}--></a>
                    </script>
                  </div>

                </div>
              </div>
    </div>

<script src="/static/lay/layui/layui.js"></script>
<script type="text/javascript">
    layui.config({
       base: '/static/lay/' //静态资源所在路径
    }).extend({
         roleper:'lib/roleper'
         , xadmin:'lib/xadmin'
         , lang:'lib/lang'
       }).use(['roleper', 'xadmin', 'table','lang'], function () {

            var $ = layui.$
            , form = layui.form
            , table = layui.table
            , roleper = layui.roleper
            , toolbar = roleper.showtool({mid:31}) ? false : true; //根据权限是否显示操作列
            var lang=layui.lang.init();
            table.render({
            elem: '#withdrawlist'
            , height: 'auto'
            , url: 'withdraw' //数据接口
            , method: 'post'
            , where: {"aid":<!--{$datainfo.aid}-->}
            , page: true //开启分页
            , limit: 10
            , toolbar: '#withdrawtop'
            , defaultToolbar: ['filter', 'exports', 'print']
            , cols: [[ //表头
                {field: 'zizeng', title: function(){ return lang.serial }, align: "center", fixwidth: true, width: 80, templet:'#zizeng'},
                {field: 'username', title: function(){ return lang.agent }},
                {field: 'realname', title: function(){ return lang.realname }},
                {field: 'type', title: function(){ return lang.class },
                 templet: function(d) {
                       if (d.type == 1) {
                            return '<button class="layui-btn layui-btn-green layui-btn-xs">'+lang.withdrawal+'</button>';
                        } else if(d.type == 2) {
                            return '<button class="layui-btn layui-btn-xs">'+lang.payment+'</button>';
                        } else if(d.type == 3) {
                            return '<button class="layui-btn layui-btn-danger layui-btn-xs">'+lang.cutpay+'</button>';
                        } else {
                            return '<button class="layui-btn layui-btn-primary layui-btn-xs">'+lang.error+'</button>';
                        }
                  }
                },
                {field: 'currency', title: function(){ return lang.cashout+lang.curtype}},
                {field: 'money', title: function(){ return lang.cashout+lang.money}},
                {field: 'fee', title: function(){ return lang.fee}},
                {field: 'payaction', title: function(){ return lang.payaction+lang.money },
                    templet: function(d) {
                       if (d.money > 0) {
                            return (d.money-d.fee);
                        } else{
                            return 0.00;
                        }
                    }
                },
                {field: 'codes', title: function(){ return lang.exchange+lang.curtype}},
                {field: 'remoney', title: function(){ return lang.exchange+lang.money},
                    templet: function(d) {
                       if (d.remoney > 0) {
                            return (d.remoney-d.fee*d.rate);
                        } else{
                            return 0.00;
                        }
                    }
                },
                {field: 'rate', title: function(){ return lang.exrate}},
                {field: 'createtime', title: function(){ return lang.time}},
                {field: 'status', title: function(){ return lang.status},
                 templet: function(d) {
                       if (d.status == 1) {
                            return '<button class="layui-btn layui-btn-danger layui-btn-xs">'+lang.applying+'</button>';
                        } else if(d.status == 2) {
                            return '<button class="layui-btn layui-btn-primary layui-btn-xs">'+lang.gback+'</button>';
                        } else if(d.status == 3) {
                            return '<button class="layui-btn layui-btn-green layui-btn-xs">'+lang.pass+'</button>';  
                        } else if(d.status == 4) {
                            return '<button class="layui-btn layui-btn-primary layui-btn-xs">'+lang.payready+'</button>';
                        }
                  }
                },
                {fixed: '', title: function(){ return lang.operation }, width: 160, align: 'center', toolbar: '#withdrawlistbar', hide:toolbar}
            ]],
            done: function() {
                layer.closeAll('loading');
                roleper.render({mid:31,per:[{sys:'pay',method:'open',law:'1450*550'},{sys:'withdraw',method:'open',law:'1450*480'}],full:false});//law 设置长宽，full是否全屏，par父窗口打开
            }
            });

            table.render({
            elem: '#recharge'
            , height: 'auto'
            , url: 'rechargelist' //数据接口
            , method: 'post'
            , where: {"aid":<!--{$datainfo.aid}-->}
            , page: true //开启分页
            , limit: 10
            , toolbar: '#rechargetop'
            , defaultToolbar: ['filter', 'exports', 'print']
            , cols: [[ //表头
                {field: 'zizeng', title: function(){ return lang.serial }, align: "center", fixwidth: true, width: 80, templet:'#zizeng'},
                {field: 'username', title: function(){ return lang.account }},
                {field: 'realname', title: function(){ return lang.realname }},
                {field: 'currency', title: function(){ return lang.cashin+lang.curtype}},
                {field: 'money', title: function(){ return lang.cashin+lang.money}},
                {field: 'integra',  title: function(){ return lang.give+lang.money}},
                {field: 'codes', title: function(){ return lang.exchange+lang.curtype}},
                {field: 'remoney',  title: function(){ return lang.exchange+lang.money}},
                {field: 'reintegra',  title: function(){ return lang.exchange+lang.give+lang.money}},
                {field: 'rate', title: function(){ return lang.exrate}},
                {field: 'type',  title: function(){ return lang.type},
                 templet: function(d) {
                       if (d.type == 1) {
                            return '<button class="layui-btn layui-btn-danger layui-btn-xs">'+lang.tradeing+lang.cashin+'</button>';
                        } else if(d.type == 2) {
                            return '<button class="layui-btn layui-btn-xs">'+lang.virtual+lang.cashin+'</button>';
                        } 
                  }
                },
                {field: 'method', title: function(){ return lang.method},
                 templet: function(d) {
                       if (d.method == 1) {
                            return '<button class="layui-btn layui-btn-green layui-btn-xs">'+lang.online+lang.cashin+'</button>';
                        } else if(d.method == 2) {
                            return '<button class="layui-btn layui-btn-danger layui-btn-xs">'+lang.noauto+lang.cashin+'</button>';
                        } 
                  }
                },
                {field: 'createtime', title: function(){ return lang.time}},
                {field: 'status', title: function(){ return lang.status},
                 templet: function(d) {
                       if (d.status == 1) {
                            return '<button class="layui-btn layui-btn-danger layui-btn-xs">'+lang.applying+'</button>';
                        } else if(d.status == 2) {
                            return '<button class="layui-btn layui-btn-xs layui-btn-primary">'+lang.gback+'</button>';
                        } else if(d.status == 3) {
                            return '<button class="layui-btn layui-btn-green layui-btn-xs">'+lang.pass+'</button>';
                        }
                  }
                },
                {fixed: '', title: function(){ return lang.operation }, width: 160, align: 'center', toolbar: '#rechargebar', hide:toolbar}
            ]],
            done: function() {
                layer.closeAll('loading');
                roleper.render({mid:31,per:[{sys:'recharge',method:'open', law:'1380*390'},{sys:'redit',method:'open', law:'1380*500'}],full:false});//law 设置长宽，full是否全屏，par父窗口打开
            }
            });
            table.on('toolbar(withdrawlist)', function(obj){
                switch(obj.event){
                    case 'rewithdraw':
                        //执行重载
                        table.reload('withdrawlist');
                    break;
                };
            });
            table.on('toolbar(recharge)', function(obj){
                switch(obj.event){
                    case 'rerecharge':
                        //执行重载
                        table.reload('recharge');
                    break;
                };
            });
            
    });
</script>
</body>
</html>

